<template>
    <div>
        这是父子组件页
        <router-link 
            v-for="(item, index) in routerList"
            :key="index"
            :to="item.path">
            {{item.name}}
        </router-link>
        <router-view></router-view>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import router from '@/router'
export default defineComponent({
    name:'parentChild',
    setup() {
        console.log(router,router.currentRoute.value.name)
        const route = (router.options.routes.find(i => i.name === router.currentRoute.value.name))
        
        const routerList = (route as any).children

        console.log(routerList)

        return{
            routerList
        }
    }
})
</script>